package com.yf1706.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.yf1706.bean.EmpPositionChangeRecord;
import com.yf1706.bean.User;
import com.yf1706.service.ApproveService;
import com.yf1706.tools.UserTools;
import com.yf1706.vo.Information;

@Controller
@RequestMapping("desktop")
public class DesktopController {
	@Autowired
	private ApproveService as;
	@Autowired
	private UserTools ut;
	@RequestMapping("getRemindMsg")
	@ResponseBody
	public Information getRemindMsg(HttpServletRequest request){
		System.out.println("进入getRemindMsg");
		User user=ut.getUser(request);
		int pcrApproveNum=as.queryApproveNum(user.getUserId());
		int pcrEditNum=as.queryEditNum(user.getUserId());
		Map<String,Object> map=new HashMap<>();
		map.put("pcrApproveNum", pcrApproveNum);
		map.put("pcrEditNum", pcrEditNum);
		System.out.println(pcrApproveNum+":"+pcrEditNum);
		Information info=new Information(true, map);
		
		return info;
	}
}
